Improve xcsv modularization, fix some xcsv end cases. (#476)
* Improve xcsv modularization, fix some xcsv end cases.
Add a test for various textual outputs from main. Some of these are
for the user, and some of these are primarly for passing information
to the doc or the GUI. While the reference files will have to change
anytime we add/delete a filter or format, or anytime a filter or format
has an arugment change, this test prevents bugs from unintentionally
changing the information passed to the GUI. As the GUI has no automated
test those types of bugs are difficult to find.
Enhance csv test to cover more end cases with the xcsv format. Historically
these cases have involved a series of xcsv format operations. These operations
may be using internal style files or passed style files. These operations may
or may not involve postional arugments on the command line. Some of these end
cases represented bugs previous to this PR, e.g. a series of input operations
where a xcsv format using an internal style is followed by an xcsv format using
a passsed style file.
Refactor XcsvFile, splitting sytle information into XcsvStyle. This allows
xcsv_file to be private. A XcsvStyle object is returned to Vecs by
xcsv_read_internalstyle that can Vecs can parse to build vectors containing
the real formats and the style based formats. This also eliminates bugs as
we build a new XcsvFile object every time we parse an external or internal
style file so we don't have any accidental dependiencies on previous operations.
Some other xcsv bugs are fixed:
DATUM was always ignored in a style file.
#474 xcsv style derived formats may have wrong GUI and/or CLI capability.
Behavoir now matches the document, which is likely not to be what some of
the style file authors intended! E.g. should gpsdrivetrack really be
working with waypoints as they do after this PR and as is documented,
or was the accidental operation with tracks desired?
Use gpsbabel::textstream in xcsv.
Stay tuned for xcsv to become a real Format as opposed to a LegacyFormat.
* try to get serialization test to work across OSs.
* disable serialization test under valgrind ...
and disable usage test on all platforms.
we have known leaks in Vecs::sort_and_unify.
usage test fails on windows under appveyor, the sed line doesn't
seem to work.
* ok, twos tests have the executable name embedded.
* Limit # of waypoints holux writer tries to write
so the writer doesn't write passed the end of the write buffer.
* eliminate unnecessary const_cast.
22 files changed: